

public class StringUtils {
	public static boolean isEmpty(String str) {
		if (str == null || str.equals(""))
			return true;
		return false;
	}
	
	public static String cutHeadAndTail(String oriStr,String tag){
		if(oriStr==null || oriStr.equals("")||tag==null || tag.equals(""))
			return oriStr;
		while(oriStr.startsWith(tag))
			oriStr=oriStr.substring(tag.length());
		while(oriStr.endsWith(tag))
			oriStr=oriStr.substring(0,oriStr.length()-tag.length());
		return oriStr;
	}

	public static String getXx(String str) {
		return str.substring(0, 1).toUpperCase() + str.substring(1);
	}
	
	public static boolean contains(String a,String b){
		if(a!=null && !a.equals("") &&b!=null && !b.equals("") && a.indexOf(b)>-1 )
			return true;
		return false;
	}
	
	
	public static String array2Str(String[] array, String seperator) {
		String result = "";
		for (int i = 0, length = array.length; i < length; i++) {
			result += "," + array[i];
		}
		if (result.length() > 0) {
			return result.substring(1);
		} else {
			return "";
		}
	}

	public static String null2Space(String str) {
		return str == null ? "" : str;
	}

}
